package com.etone.smartAudit.controller;

import com.etone.smartAudit.service.CityService;
import com.etone.smartAudit.vo.city.CityVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 蒋学伟
 * @create: 2020-07-08 08:34:37
 * @Description CityController
 */
@AllArgsConstructor
@RestController
@Api(tags = "城市管理", value = "CityController")
public class CityController {

    private CityService cityService;

    @ApiOperation(value = "获取城市《完》")
    @GetMapping("/citys")
    public List<CityVO> list(
            @ApiParam(value = "省份id（默认广东省，可以不填写）（预留）") @RequestParam(required = false, defaultValue = "10025") int provinceId
    ) {
        return cityService.list(provinceId);
    }
}
